package com.hspedu.homework;

/**
 * 写出程序的执行结果
 */
public class Homework07 {
}
class Test{
    String name = "Rose";
    Test(){
        System.out.println("Test");
    }
    Test(String name){
        this.name = name;
    }
}

class Demo extends Test{
    String name = "Jack";

    public Demo() {
        super();//Test
        System.out.println("Demo");
    }
    Demo(String s){
        super(s);
    }
    public void test(){
        System.out.println(super.name);//Rose
        System.out.println(this.name);//Jack
    }

    public static void main(String[] args) {
        new Demo().test();//Test Demo Rose Jack
        new Demo("John").test();//John Jack
    }
}